<?php
/**
 * @project     : Travel
 * @copyright   : 
 * @desc        : Thuc hien cac thao tac tren bang supportonline
 * @coder       : Truong cong quyen
 * @createdate  : 3/11/2011
*/
class Supportonline_model extends CI_Model
{
    var $supportonline_id=0;
    var $supportonline_nickname='';
    var $supportonline_name_vi='';
    var $supportonline_name_en='';
    var $supportonline_type_nick='';
    var $supportonline_status=1;

   
    public function __construct() {
        parent::__construct();
    }
    
    function get_all($status=1)
    {
        if($status!=-1)
        {
            $this->db->where('supportonline_status', $status);
        }
        $query = $this->db->get('supportonline');
        return $query->result();
        
    }
    
     function get_by_id($id)
    {
        $this->db->where('supportonline_id', $id);
        $query = $this->db->get('supportonline');
        return $query->row();
    }
    function get_by_type($type=0,$limit=1,$status=1)
    {
        $this->db->where('supportonline_type_nick',$type);
        $this->db->where('supportonline_status',$status);
        $this->db->limit($limit);
        $query=$this->db->get('supportonline');
        return $query->result();        
    }

}